package com.mx.tool.util;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import org.jetbrains.annotations.NotNull;

/**
 * @Author: mengxiang.
 * @Date: 2020/6/22.
 * @Time: 11:37 上午.
 * @Description:
 */
public class NotifyUtil {

    private static final String TITLE = "提示";
    private static final String GROUP_DISPLAY_ID = "MX-TOOLS";

    public static void info(@NotNull String content) {
        notify(content, NotificationType.INFORMATION);
    }

    public static void warning(@NotNull String content) {
        notify(content, NotificationType.WARNING);
    }

    public static void error(@NotNull String content) {
        notify(content, NotificationType.ERROR);
    }

    public static void notify(@NotNull String content, @NotNull NotificationType type) {
        Notifications.Bus.notify(new Notification(GROUP_DISPLAY_ID, TITLE, content, type));
    }
}
